import Vue from 'vue'
import VueRouter from "vue-router";


import Article from "../views/article.vue"
import Collect from "../views/collect.vue"
import Layout from "../views/layout.vue"
import Like from "../views/like.vue"
import User from "../views/user.vue"
import Detail from "../views/detail.vue"

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      name: 'default',
      path: '/',
      redirect: '/article',
    },
    {
      name: 'Layout',
      path: '/layout',
      component: Layout,
      children: [
        {
          name: 'Article',
          path: '/article',
          component: Article,
        },
        {
          name: 'Collect',
          path: '/collect',
          component: Collect,
        },
        {
          name: 'Like',
          path: '/like',
          component: Like,
        },
        {
          name: 'User',
          path: '/user',
          component: User,
        },
      ],
    },
    {
      name: 'Detail',
      path: '/detail/:id',
      component: Detail,
    },
  ],
})

export default router